It seems you're missing some devel packages on your system. See my article here, specifically this step. I'm not sure, but the MD5 code could be part of libssl, so it would be covered by installing these packages.
$ sudo apt-get install zlib1g-dev libreadline5-dev libssl-dev libxml2-dev