diff --git a/README.md b/README.md
index c575d0564704afd19f4f9f05a077f8a6337af42f..77ea9355a3e645fdc788fe7d93b90b68b1565b36 100644
--- a/README.md
+++ b/README.md
@@ -348,5 +348,5 @@ folder where you want Dynare installed.
 - `make -j`
 - **(Optional)** To then build mex files for Octave, run
      - `cd mex/build/octave`
-     - `CC=gcc-9 CXX=g++-9 ./configure --with-matio=/usr/local --with-gsl=/usr/local --with-slicot=/usr/local LDFLAGS=-L/usr/local/lib`
+     - `CC=gcc-9 CXX=g++-9 ./configure --with-matio=/usr/local --with-gsl=/usr/local --with-slicot=/usr/local LDFLAGS=-L/usr/local/lib LEX=/usr/local/opt/flex/bin/flex YACC=/usr/local/opt/bison/bin/bison`
      - `make -j`
diff --git a/macOS/build.sh b/macOS/build.sh
index dd696db5d8fa8aa3704d9a2d6ccc337753fce25b..fec2090562f15bf6c43ea323a318cceac9a0958b 100755
--- a/macOS/build.sh
+++ b/macOS/build.sh
@@ -69,6 +69,8 @@ CC=$CC CXX=$CXX ./configure \
   PACKAGE_STRING="dynare $VERSION" \
   CXXFLAGS=-I/usr/local/include \
   LDFLAGS=-static-libgcc \
+  LEX=/usr/local/opt/flex/bin/flex \
+  YACC=/usr/local/opt/bison/bin/bison \
   --with-gsl="$LIB64"/gsl \
   --with-matio="$LIB64"/matio \
   --with-slicot="$LIB64"/Slicot/with-underscore \
diff --git a/preprocessor b/preprocessor
index 5365cc3b86e0cb447d7c10d1b1ba83d1914dec74..bfc002a054ad44449671ef2bc54d5fe9f2202138 160000
--- a/preprocessor
+++ b/preprocessor
@@ -1 +1 @@
-Subproject commit 5365cc3b86e0cb447d7c10d1b1ba83d1914dec74
+Subproject commit bfc002a054ad44449671ef2bc54d5fe9f2202138