excerpts from "man links"
-g Run Links in graphics mode. If not given, Links will run in text mode. Running in graphics mode means that Links will probe all compiled-in graphics devices and run on the first found. If none found, links will not run in text mode. This option works only if --enable-graphics was given to ./configure.
-driver <driver name>
Graphics driver to use. Drivers are: x, svgalib, fb, directfb, pmshell, atheos. List of drivers will be shown if you give it an unknown driver. Available drivers depend on your operating system and available libraries.
$ links -g -driver x http://www.google.com
Unknown graphics driver x.
The following graphics drivers are supported:
when you run links -g in console it probably works for you because you have a framebuffer console, so links uses the fb driver.
if you launch X and you don't run it using the framebuffer driver, the -g mode can't work because svgalib isn't supported and the framebuffer is not available.