added threads.c and changed makefile.mk