Make sure you have all required tools and libraries installed. You'll need GNU compiler and linker and header and library files for following libraries: glibc, openssl-0.9.8, zlib, expat, libavcodec, qt4 or qt5. You may use the following command to install all prerequisites on debian-based system like ubuntu:

OPTIONAL: Building with latest libavcodec
Starting with version 1.8.6 MakeMKV links directly to libavcodec. Please note that most distributions ship a very outdated version of libavcodec (either from ffmpeg or libav projects). You will have to compile a recent ffmpeg (at least 2.0) if you need a FLAC encoder that handles 24-bit audio. Also you will have to enable libfdk-aac support in ffmpeg in order to use AAC encoder. Starting from version 1.12.1 DTS-HD decoding is handled by ffmpeg as well, so you would need a recent one. Here are generic instructions for building makemkv-oss with latest ffmpeg:
- download ffmpeg tarball from http://ffmpeg.org/download.html
- configure and build ffmpeg: