Added option to build with multiple threads