I am trying to use model references in my project. If I compile the model without any references it works fine. But if I convert a subsystem to a model reference, error occur when compiling.

I have double checked the system target file and the template makefile on the model reference are the same as the main project file. Is there anything I need to change when creating a model reference?
I have attached a simple test model where the error occurs during build