add lpthread flag
improved makefile
added gitignore
Merge pull request #1 from deric/master

Makefile improvements