Please make sure that build-essential is installed in your linux
sudo dpkg --get-selections | grep build-essential | wc -l
if you get 0 as output then install build-essential
sudo apt-get install build-essential
Then install gcc
sudo apt-get install gcc