This is based on @haberman's changes in #8257. Now that we're using
std::mutex we no longer need to check whether pthreads are available, so
this commit removes references to HAVE_PTHREAD. I left the autotools
build alone, though, since we are likely to drop support for it soon
anyway.
That should be only on the CFlags. When using the compiler
as the linker driver, one may want to also call pkg-config to get the
cflags, but when invoking the linker, there should be no compiler flags.
Currently, downstream libraries such as RProtoBuf fail because
`-std=c++11` is required via `configure.ac`, but RProtobuf has no way
of knowing this by consulting `pkg-config --cflags protobuf`.