ensure g++ version checking for CXX

It is important that we check the version of CXX, not of CXX_DEP_GEN.
For CXX_DEP_GEN an older version might be sufficient.  For CXX we need
a recent version.