Alright, so I managed to solve the problem. I’ll keep my first post there in case someone has a similar problem.
I still have no idea why the above didn’t work but now I at least know how to make it work. The Vince’s post was a great help.
To build glulxe with cheapglk/remglk in an ifstuff folder, you need to do this (all credit to Vince, I only added the folder removal if you need to build both versions):
rm -rf ifstuff # this needs to be done, since once you build glulxe with one of {cheapglk|remglk}, you can't build it with the other unless you clean the folder
mkdir ifstuff
cd ifstuff
git clone https://github.com/erkyrath/glulxe
git clone https://github.com/erkyrath/{cheapglk|remglk}
cd {cheapglk|remglk}
make
cd ../glulxe
edit Makefile # toggle comments on {cheapglk|remglk} lines and save
make
mv glulxe {cheap|rem}glulxe
Now I have no idea why what I did before didn’t work. The issues might include: I used Windows to get the files from git and edit makefiles. Maybe that broke them. I also used one glulxe folder while trying to build it with cheap/remglk.