Use optimoptions instead of otimset as recommended in never versions of matlab

http://www.mathworks.se/help/optim/ug/optimoptions-and-optimset.html
Use -nodesktop instead of -nojvm when calling matlab. -nojvm prevents the use of handle graphics in newer versions of Matlab
File made C89 compatible. Since the only free x64 compiler on windows does not support c99
Removed platform specific extension of library file.