Only try to set -stdlib=libstdc++ if compiling with clang