Add static linking support for boost_thread

Fixes #634