fixed makefile. among other things, we had to link to pthread on linux.
find another way to keep console window open.