build with thread support