improved makefile, fixed some warnings and removed linking on pthread (unused)