diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1f51a5b1732f0a50708687e3c5700d0e09add8a9..0bc8db586bc60317e08f622cc16b68d97702f067 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,7 +1,7 @@
 before_script:
   - git clone https://git.dynare.org/Dynare/dseries.git
 
-testsuite_matlab:
+test_matlab:
   stage: test
   script:
     - make check-matlab
@@ -9,7 +9,17 @@ testsuite_matlab:
     paths:
       - test/my/report/dir/report.pdf
 
-testsuite_octave:
+test_old_matlab:
+  stage: test
+  variables:
+    MATLAB: /usr/local/MATLAB/R2009b/bin/matlab
+  script:
+    - make check-matlab
+  artifacts:
+    paths:
+      - test/my/report/dir/report.pdf
+
+test_octave:
   stage: test
   script:
     - make check-octave
diff --git a/Makefile b/Makefile
index 41ac96e0bee59a5eda315ad17b56c8b72819e277..6b5a366891259cfbf72f135cc1cc92b304dae6d2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-OCTAVE=octave-cli
-MATLAB=`which matlab`
+OCTAVE ?= octave-cli
+MATLAB ?= $(shell which matlab)
 
 all: check-octave check-matlab