Contrib/build tweaks

I ran into a few minor hiccups trying to build the current imapfilter on my Crunchbang (Debian 7.0-based) system.  Two of the three commits here make it build nicely for me, the .gitignore commit just helps me see what I'm actually changing and may or may not be of interest to you.