Try running "configure -help" wherever you Qt is installed to (eg. C:\Qt\4.2.2).

It will show you that the default option for GIF support is "-no-gif". To compile Qt with GIF support turned on, pass "-qt-gif" as a parameter to the configure.
C:\Qt\4.2.2\> configure -qt-gif
Once the configure finishes, you are ready to recompile Qt. Follow the instructions as it depends on the compiler you are using.