configure: Fix ld flags when rpath is enabled.