The build fails because some C headers got removed from mesa-19.2.2. Using libGL seems to be the correct way to use GL related headers.