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

This simplifies the compiler commands and suppresses warnings.