Make Makefile safe for parallel compilation.
Merge pull request #39 from ppd1990/makefile-threaded

Make Makefile safe for parallel compilation.