Fixed win32 build. Added -pthread flag for UNIX build.