added support for multi-threaded compilation