Cherry-picked configure and rpmbuild fixes from libzmq/master 

I've cherry-picked my and @pmienk's recent configuration changes from libzmq/master.