Adjusted to use -stdlib=libstdc++ for linux.