Refine the Makefile for main module and plugin.