Add makefile and fix the build

The threads.c file has been removed as it is identical to the threads.cpp.