don't pass LDFLAGS when only compiling
Merge pull request #456 from longjon/spurious-ldflags

Don't pass LDFLAGS when only performing compilation (-c)