I installed imlib2-config in ~/bin, and put ~/bin in my path. But the ~ is not expanded in the configure script, so it say it's not installed!
Turns out it's pretty simple to fix: instead of "~/bin", put "$HOME/bin" in the PATH. But it would be better if the configure script expanded the ~ like most other programs.