Try to install the Imagick PHP extension using apt-get instead of compiling it