Did you run something as root?
You need to install the dependencies (cmake, etc). https://dev.px4.io/starting-installing-linux.html
I recommend you start with the dev guide to install all required packages, then do a fresh clone as a regular user and try building again.