Use ENV.cxx instead of gcc -lstdc++ for testing as suggested by @jenshnielsen.