diff --git a/test/simulink_codegen_tests/ert_unix.tmf b/test/simulink_codegen_tests/ert_unix.tmf
index 35959367a89defea160dd7951b69038ce14965f3..2848cbd4b36aa4400987734e11d14da60e5541d0 100644
--- a/test/simulink_codegen_tests/ert_unix.tmf
+++ b/test/simulink_codegen_tests/ert_unix.tmf
@@ -303,6 +303,13 @@ ifeq ($(SFCN),0)
 SYSLIBS += -lm
 endif
 
+# Additional .so for compiling DM controllers, RTWINCLUDEAOT has
+# to be set before building, e.g. setenv('RTWINCLUDEAOT','1') from
+# the compiling matlab session
+ifeq ($(RTWINCLUDEAOT),1)
+SYSLIBS += -lexport_aot_model_linux
+endif
+
 LIBS =
 |>START_PRECOMP_LIBRARIES<|
 ifeq ($(OPT_OPTS),$(DEFAULT_OPT_OPTS))