refine Makefile for all platform