mjpegtools requires avifile and/or some of its dependencies or else it will fail to build. those dependencies need to be added so that it won't fail. Many people are seeing this problem when upgrading to gnome 2.2+ but most do not know how to solve it.
from ebuild avi? ( media-video/avifile )