Do not add -I$prefix flag when looking for OpenGL. There are no headers there.
--- aclocal.m4.orig	2026-03-31 07:12:57.000000000 -0500
+++ aclocal.m4	2026-03-31 07:16:30.000000000 -0500
@@ -328,7 +328,7 @@
 if test "x$with_opengl" != "xno"; then
 
   if test  "x$opengl_HOME" != "x" ; then
-    save_flags([-I${opengl_HOME}], [-L${opengl_HOME}/lib], [])
+    save_flags([-I${opengl_HOME}/include], [-L${opengl_HOME}/lib], [])
   else
     save_flags([], [], [])
   fi
