Minor change to lib/thread.h - should sort out compilation issues on MacOSX