Added -pthread compiler flag for Unix builds.