Makefile fix

Please note that at this moment this doesn't compile due to missing commits merge in core and some problem in `src/device.c`.