The libraries are sometimes not found because they have been placed in directories not scanned by the system during the compilation or the execution. A way to solve this is to properly set the environment variables. Assuming you are using the bash system, add the following lines to the file $HOME/.bashrc
:
export LIBRARY_PATH=/usr/local/lib:$LIBRARY_PATH
Launch a new terminal and try again.
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH