diff --git a/src/DynareMain.cc b/src/DynareMain.cc
index e16c7697e72699b8ba60ebe97d26b21ac7f79379..4968cccbc5221a44f0f84c128fea5244202a679b 100644
--- a/src/DynareMain.cc
+++ b/src/DynareMain.cc
@@ -503,8 +503,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 408952eb8c53fcd950d1ad1e8d6dd897b2689a98..23c513d6cf51f97f9d6a2f9e6a3ab0a9cc11fc6d 100644
--- a/src/ModelTree.cc
+++ b/src/ModelTree.cc
@@ -45,7 +45,7 @@ condition_variable_any ModelTree::mex_compilation_cv;
 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)
@@ -1839,6 +1839,7 @@ void
 ModelTree::initializeMEXCompilationWorkers(int numworkers, const filesystem::path &dynareroot,
                                            const string &mexext)
 {
+  /*
   assert(numworkers > 0);
   assert(mex_compilation_workers.empty());
 
@@ -1925,7 +1926,7 @@ ModelTree::initializeMEXCompilationWorkers(int numworkers, const filesystem::pat
           exit(EXIT_FAILURE);
         }
     }
-#endif
+*/
 }
 
 void
diff --git a/src/ModelTree.hh b/src/ModelTree.hh
index 7098c0d6f1ab6293a95bc390ad9ccd17ba09d390..88eccc00d1d14af70b6caf730c334c9fc067ac74 100644
--- a/src/ModelTree.hh
+++ b/src/ModelTree.hh
@@ -410,7 +410,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