Fix some missing dependencies and call ldconfig at the end