Makefile refactoring, move BOARD support to extra files. fix make_libs.sh for CHIP define use