giflib patches to build on Gentoo

giflib-4.1.6 did not build properly on Gentoo (with gcc-4.7.3).
Patches included from portage to enable building on this platform.