configure: Fix ld flags when rpath is enabled.

Provide correct rpath flags to ld when --enable-rpath is provided.