The relevant error here is:
/usr/bin/ld: cannot find -lGL
which seems similar to this issue. I reckon you need to install the right libgl-dev package - but that unfortunately depends on your graphics drivers. If you are using the open-source drivers (mesa), then the correct package would be libgl1-mesa-dev (as per the installation instructions on the MRtrix3 documentation). But if you’re using the nvidia proprietary drivers, then according to this search, these should come with one of the nvidia-361, nvidia-340, or nvidia-304 packages (depending on your hardware). Try installing (or re-installing) whichever package is the right one, see what happens…