Implements queues, improves makefile, lib-fixes