add build system for the C code

Signed-off-by: Jan Dvořák <mordae@anilinux.org>