Since I'm not very experienced in working with linker files, can you please have a quick look at what I've "produced"? Note that the rest of the code gets corrupted or throws some kind of segfaults now because I made some rookie mistake.
I added the following:
The Matlab linker file contains some additional lines of code. Do I need them?