What Linux distro are you running? I'll ignore the warns and address the link error:
It looks like the g++ libraries are not installed on your system, and MATLAB needs to them to link. Yes, you are "only" using C and not C++, but the MATLAB libraries you link against require C++ libraries.
In short, you'll want to install the "gcc-g++" package, or something with a similar name, depending on the distribution you are using.