Some explanation given by upstream about using the make targets in the
Makefile provided with the examples in /usr/share/doc/cimg-dev/examples:


  It seems you are compiling the examples of CImg with the 'Mlinux'
  Makefile entry, which is the 'maximum' possible configuration, and
  requires the most dependencies as possible. In fact, the CImg examples
  do not need these dependancies at all. This makefile entry is useful
  only when someone want to copy/paste the Makefile for his own project
  that require such dependencies. But for the compilation of the CImg
  examples, it is really useless. It won't add extra-features to the
  examples. To compile the CImg examples, the best configuration is
  probably the 'olinux' entry, which requires very few dependencies and
  enable optimization.  Using this makefile entry naturally reduces the
  compilation command to :

$ make olinux
make[1]: Entering directory `/src/CImg/examples'

** Compiling 'CImg_demo (_cimg_version)' with 'gcc version 4.4.5
(Ubuntu/Linaro 4.4.4-14ubuntu5) '

g++ -o CImg_demo CImg_demo.cpp -I.. -Wall -W -lm -ansi -pedantic -O3
-fno-tree-pre -Dcimg_use_vt100 -I/usr/X11R6/include -Dcimg_use_xshm
-Dcimg_use_xrandr -L/usr/X11R6/lib -lpthread -lX11 -lXext -lXrandr

  And you need only the pthread, X11 and Xrandr library. Even XRandr is
  unnecessary and will be removed by default for the next 1.4.6 release. I
  provided a 'complete' Makefile by putting all possible options there, so
  people can easily create their own custom Makefile if needed. But for
  the CImg examples, the minimal configuration is enough.

