Hi Stefano,
to be able to use some library with Simulink Desktop Real-Time, the library must be available in source form (C or C++) and the library code must be compilable for real-time operation. I don't think this is the case with LAPACK and I'm afraid LAPACK will not be usable for creating real-time code.
At this point, you have two options. Either you can use Simulink Desktop Real-Time in Connected IO mode. In this mode, your Simulink model runs uncompiled, your S-function runs as-is, and I/O operations are performed by Simulink Desktop Real-Time blocks. While the overall performance is not as high as with compiled code, it may work very well if the sample rate of the model is not too high. This is probably what I'd try first.
Or, you can also rewrite your set of equations to a Simulink model using no S-function or LAPACK - just using the integrators, gains, nonlinearities, etc. If your model follows the equation you have outlined, this should be possible, but, depending on the complexity and size of the model, it may be a lot of work. However, your model will then be compilable and will be able to run with the highest performance available.
Good Luck, Jan