In WT-4655, we are proposing disabling the build for workgen if we're not using cc as a compiler. This is basically to ensure that we have a working set of compilers (clang++ installed on Ubuntu doesn't work), but also addresses an interoperability problem: if you configure with CC=clang and not set CXX, you'll get gcc's c++ trying to interoperate with clang.
To detect problems more directly (and allow builds of workgen to use clang), it could make sense to have configure test out: build a function in a C module, and call it from a C++ main. If that fails, the caller must set CC/CXX/CXXLINK appropriately.