Pthread stuff and makefile changes.