I\'m using a VM with the following configuration:
On Ubuntu, I fixed (or really, avoided) a similar error with
sudo apt-get install libghc-zlib-dev libghc-zlib-bindings-dev
(I don't know if both are needed.)