A header file *.h in most cases only contains a definition of a function.
The body of a function is inside a precompiled library. So unless the function is inside the standard library, you need to specify the library your executable should be linked against. Otherwise you'll get undefined reference errors. All the pthread functions are in libpthread.so
so you need to specify -lpthread (you always omit the lib) when compiling something.
It should be documented in the guide you are using ( or maybe they thought it's obvious...)
P.S. Ahhhh and welcome to LQ