Fix linkage of mex files.