diff --git a/macOS/Makefile b/macOS/Makefile
index f7c4fb3cf1bab41feee75d413041df5d9c369a49..3a51bd58a58776dba4d014ceed328fca1e9e2b54 100644
--- a/macOS/Makefile
+++ b/macOS/Makefile
@@ -1,4 +1,4 @@
-# Copyright © 2019 Dynare Team
+# Copyright © 2019-2023 Dynare Team
 #
 # This file is part of Dynare.
 #
@@ -17,7 +17,7 @@
 
 .PHONY: all deps clean-deps clean clean-all build
 
-NTHREADS=$(shell nproc)
+NTHREADS=$(shell sysctl -n hw.ncpu)
 
 all: build