diff --git a/src/DynareMain.cc b/src/DynareMain.cc
index 4e9ff55aef86d93e355572b45ade8c5b97025e1e..8b0b6a4546cd207b7aca027a2a0bfb73fb82970d 100644
--- a/src/DynareMain.cc
+++ b/src/DynareMain.cc
@@ -509,8 +509,7 @@ main(int argc, char** argv)
     }
 
   if (mod_file->use_dll)
-    ModelTree::initializeMEXCompilationWorkers(max(jthread::hardware_concurrency(), 1U), dynareroot,
-                                               mexext);
+    ModelTree::initializeMEXCompilationWorkers(max(thread::hardware_concurrency(), 1U));
 
   if (json == JsonOutputPointType::parsing)
     mod_file->writeJsonOutput(basename, json, json_output_mode, onlyjson);
diff --git a/src/ModelTree.cc b/src/ModelTree.cc
index 41bed024ef26df24163dd96f549c225f54628a0f..2e7997656af813e09db8e7c9ddebbeb1ed8fc42b 100644
--- a/src/ModelTree.cc
+++ b/src/ModelTree.cc
@@ -46,7 +46,7 @@ mutex ModelTree::mex_compilation_mut;
 vector<tuple<filesystem::path, set<filesystem::path>, string>> ModelTree::mex_compilation_queue;
 set<filesystem::path> ModelTree::mex_compilation_ongoing, ModelTree::mex_compilation_done,
     ModelTree::mex_compilation_failed;
-vector<jthread> ModelTree::mex_compilation_workers;
+vector<thread> ModelTree::mex_compilation_workers;
 
 void
 ModelTree::copyHelper(const ModelTree& m)
@@ -1921,6 +1921,7 @@ void
 ModelTree::initializeMEXCompilationWorkers(int numworkers, const filesystem::path& dynareroot,
                                            const string& mexext)
 {
+  /*
   assert(numworkers > 0);
   assert(mex_compilation_workers.empty());
 
@@ -2012,7 +2013,7 @@ ModelTree::initializeMEXCompilationWorkers(int numworkers, const filesystem::pat
           exit(EXIT_FAILURE);
         }
     }
-#endif
+*/
 }
 
 void
diff --git a/src/ModelTree.hh b/src/ModelTree.hh
index 8d068593e996ba48ccc1ecc84885c0c78e01e823..72fcb700dc7324de81f70287142dce74f92b4cc1 100644
--- a/src/ModelTree.hh
+++ b/src/ModelTree.hh
@@ -433,7 +433,7 @@ private:
   vector<int> endo2eq;
 
   // Stores workers used for compiling MEX files in parallel
-  static vector<jthread> mex_compilation_workers;
+  static vector<thread> mex_compilation_workers;
 
   /* The following variables implement the thread synchronization mechanism for
      limiting the number of concurrent GCC processes and tracking dependencies