Fix checking for C++ compiler.

Some versions/systems don't like not having stdout, and return a
non-zero exit code if it's missing.
Merge pull request #35 from booch/fix-cxx-detection

Fix checking for C++ compiler