restart while wiringPi compile

I wanted to reinstall whole DietPi (I had problems with motion camera, it stuck after few days of working, but it is another problem).
Nevertheless I want to install wiringPi package proceeding following commands:

apt-get update
apt-get upgrade
apt-get install git-core
git clone git://
cd wiringPi
apt-get install make
apt-get install gcc

git pull origin

unfortunatelly when running ./build script DietPi restarts showing this info:

root@DietPKu:~/wiringPi# ./build
wiringPi Build script

WiringPi Library
[Compile] wiringSerial.c
[Compile] wiringShift.c
[Compile] wiringPi.c
[Compile] piHiPri.c
[Compile] piThread.c
[Compile] wiringPiI2C.c
[Compile] wiringPiSPI.c
[Compile] softPwm.c
[Compile] softTone.c
[Compile] mcp23008.c
[Compile] mcp23016.c
[Compile] mcp23017.c
[Compile] mcp23s08.c
[Compile] mcp23s17.c
[Compile] sr595.c
[Compile] pcf8574.c

Logs are not available, or I cannot find any correct ones.
Any ideas? On version 141 it worked.


Most likely require build-essential:

apt-get install build-essential

Then try to compile it again.