Use one emergethread if build without THREADS
fix NO_THREAD_LOCAL