On AWS I install nginx into /usr/local after reboot the installation disappears

Recently I’ve started using AWS in order to serve my web applications. I’m quite experienced in managing my own web servers (Linux and macOS) but I’m kind of a newbie on AWS, Google App Engine, etc so a short introduction is in order.

I’ve subscribed to the so-called t2.micro which has 1GB RAM and eligible for free tier and I’ve opened the browser based the so-called cloudshell, I couldn’t yet manage to connect to my AWS instance? over a real Terminal like the iTerm or PuTTYbut that’s not so important now.

So, over the cloudshell I’ve changed into ~/Downloads and

curl -O https://nginx.org/download/nginx-1.16.1.tar.gz
tar -zxvf nginx-1.16.1.tar.gz && cd nginx-1.16.1
./configure --prefix=/usr/local/nginx-1.16.1 --without-pcre

It complained about gcc not being available. After some Google search:
sudo yum groupinstall "Development Tools"
installed them and they did work fine.

Question: After reboot or logout or timeout whatever it’s called, the “Development Tools” were gone i.e. I had to install them again and more critically, after I installed the nginx into /usr/local/nginx-1.16.1 it was deleted, too. How to install the “Development Tools” and more importantly the applications into /usr/local in a permanent manner?