added error checking for std::thread::hardware_concurrency
error checking for Mutex
added makefile