Fix v8 api test and tweak makefile

Review 1084 by @mlucy