Fix building on mac without a c/c++ compiler set.

Issue #6920 (CMakeLists checks for the wrong variable when setting the default C compiler.).