Help with compiling a program

I suspect you don’t have all the necessary build tools installed. Try:

sudo apt-get update
sudo apt-get install build-essential

build-essential installs a big bundle of different packages (including gcc, make and so on) that you need for compiling. While you’ve installed a few of those manually there will still be a lot that are missing.

build-essential and git are the only packages I need to install in a fresh OSMC install to start building/compiling.