build: Add 'make lint' rule and fix some problems found by pylint.