Support multi threading on linux
g++
needs to be passed the -pthread
flag when compiling / linking, for multi-threading.
Also tweak depend.mk rule a little bit to support saving object files to a build directory. Project Makefiles can set a BUILDDIR variable to their build directory - this will be used in the generated target names.