Rewrite Makefile to build naclports libraries