Bug fix: prevent the trashing of LDFLAGS.

The check for the APR library trashes the LDFLAGS environment variable, preventing later checks (such as for libconfuse) from working.