If you're writing a C/C++ program using Matlab libraries on a linux system you get errors like this if the system isn't configured properly:
/usr/bin/ld: warning: libut.so, needed by /path/removed/libmx.so, not found (try using -rpath or -rpath-link)
The reason can be found in the ld manpage: libmx.so has more dependencies, but ld can't find them. The -rpath-link linker switch might be a solution, but Linux systems have a central place for this kind of config: /etc/ld.so.conf.
If you have a directory called /etc/ld.so.conf.d/, create a file there with no other contents than the path to your matlab libs ($MATLAB/bin/glnx86 for i386) and call it matlab.conf or something like that (it needs a .conf suffix!). If this directory does not exists, append a line with this path to /etc/ld.so.conf. Then, re-run ldconfig and your problem should be solved.