Ok, this was a nobrainer:
There is a slightly wrong path in imlib/files/patch-search-system-include-for-xshm.diff. Please change "/usr/include/X11/extensions/XShm.h" to "/usr/local/include/X11/extensions/XShm.h" (note the /local/ part in it) and compile. This at least fixed the problem for my system :)
Nik
$ diff patch-search-system-include-for-xshm.diff~ patch-search-system-include-for-xshm.diff 8c8 < + if test -f "$x_includes/X11/extensions/XShm.h" || test -f "/usr/include/X11/extensions/XShm.h"; then ---
- if test -f "$x_includes/X11/extensions/XShm.h" || test -f "/usr/local/include/X11/extensions/XShm.h"; then
-- Please do not email me anything that you are not comfortable also sharing with the NSA, CIA ...