Title prety much covers it. The ebuild sould append LDFLAGS.
Could you provide : - the version of the opengl implementation you are trying to build against (nvidia, ati?) - your emerge --info - the full build.log that portage generates when there's a build failure. Thanks