Started using cmake instead of custom makefiles due to the
increasing complexity in handling libraries and platforms.