In C++ compiling happens in compilation units.
Header files are used to publish types and function signatures that a compilation unit wants to have published and source files actually implement them. This is done so that a change in one compilation unit's implementation won't require one to recompile all the other ones as well (which might take even hours if a project is huge).
Taking real advantage of this requires using Make or some other build tool, so it's really not that important for smaller projects.
However, even in smaller projects doing includes the de facto way is clean, so:
1. Only include header files. This helps to keep compilation units clean (no fear of double definitions, etc.)
2. When compiling a smallish project without the help of a build system, compiling all compilation units every time is fine:
gcc -o a.out stack.cc some_other_file.cc threadtest.cc
I assume the trouble (on the side of what 2FA pointed out) is that one of the source files is missing or there's some other problem with the Makefile. Like not compiling a compilation unit to an object file. So try to do it manually and see if that works.