Make libmicrohttpd a static lib

Plus some compilation changes where I noticed some issues and addressed
them.