Fix builds with non-GNU compilers used with Unix-style make.

An example of this is OpenWatcom.  It uses wmake but doesn't understand GNU-style warning flags.

This change fixes the problem by using the compiler, rather than the make tool, when deciding which warning flags to use.