We are building OpenCV without CUDA support (use case requires a multiplatform build), so the file cuda_gl_interop.h is not used in the build.
We also tried
sudo ln -sf /usr/lib/aarch64-linux-gnu/libGL.so.1.0.0 libGL.so
both before and after the build. The issue still persists.
The workaround we ended up using is building OpenCV with Qt4 instead of Qt5 (WITH_QT=4 CMake option). Qt4 version provided with L4T 32.2 depends on libGL and not on libGLESv2 like the provided Qt5. The issue does not occur when OpenCV is built with Qt4 and OpenGL support.