Add makefile and fix the build

The threads.c file has been removed as it is not needed and it confuses the
makefile engine.