I came across this error message, and post a few years later and while building clang-tidy for AIX.
It turns out that <mutex> doesn't define std::mutex if g++ doesn't have the "-pthread" argument.
The help for the command line option says as much Preprocessor Options Help - GCC:
pthread
Define additional macros required for using the POSIX threads library. You should use this option consistently for both compilation and linking. This option is supported on GNU/Linux targets, most other Unix derivatives, and also on x86 Cygwin and MinGW targets.
------------------------------
John Cuningham
------------------------------