Added -lpthread to makefile