CONFIGURE: Do not pass LDFLAGS to compiler when -c is specified

This fixes compatibility issues with clang when using -enable-Werror:
clang generates a warning when being passed both "-c" and linker-only
flags like "-L" or "-l". Combined with -Werror, this causes a spurious
configure failure.
Merge pull request #321 from fingolfin/configure-fix-nolink

CONFIGURE: Do not pass LDFLAGS to compiler when -c is specified