Fixed linking problems under some linux systems

Thanks to Riccardo Rossi