The initial Multithreaded “Hello, World!” most likely need a "-pthread" compiler flag. It is at least required for g++ 9.3.0.
Without it I get:
cat stage/generic/default/builtin/HelloThreadedTest/rfm_HelloThreadedTest_build.err
/scratch/cc0LAYZw.o:hello_threads.cpp:function std::thread::thread<void (&)(int), int&, void>(void (&)(int), int&): error: undefined reference to 'pthread_create'
collect2: error: ld returned 1 exit status