If you get this error:
src/freeglut_internal.h:111:39: fatal error: X11/extensions/XInput.h: No such file or directory
This might save you some time searching for the correct dev packages to install. The package it is in in the Debian repositories is called
x11proto-input-dev, but it contains the file XI.h which contains the correct headers freeglut is including. Symlink the file and you’re good to go.
cd /usr/include/X11/extensions && sudo ln -s XI.h XInput.h