Fixed makefile to link with -lpthread.
Updated makefile with 'make dist' and 'make distclean' for building release tarballs.
Changed 'make dist' to build for master branch regardless of what the current branch is.