Makefile fixes.

Ensure that the json extension is always enabled when running `make test`, and fix the build system to support compiling against a version of libv8 other than the one in `/usr/lib`.