added -threaded build flag