Use proper variable instead of hardcoded.

Library is sometimes called libjson-c.so
build: start by looking for json-c (new name) and then json
More standard compliant code.

Reducing dependency on libportable.