Fix LDFLAGS=-Wl,--as-needed support broken by -R versus -rpath test