added makefile and thread_safe.hpp