Adaptive thread count
Added Linux support for the compilation