I had the same exact problem when building Panda 1.8.1 on a Ubuntu 13.04 x86_64 host. Changing the source as you mentioned and doing the same modification to line 3916 of panda/src/glstuff/panda_glext.h fixed the build problem for me and samples are running fine.