glXSwapIntervalEXT and glXSwapIntervalSGI are extension functions; You normally access extensions' function addresses through glXGetProcAddress, though some libGL.so may export them directly.
Most easy solution: Get a OpenGL extension loader library, like GLEW (it's in all major Linux distribution's package repositories). Replace all occurances of #include <GL/gl.h>
with #include <GL/glew.h>
and #include <GL/glx.h>
with #include <GL/glxew.h>
, add libGLEW.so to your list of linked libraries, and call glewInit()
right after creating and binding a OpenGL context. Then test if the extension is actually available!