.gitignore: Add temp files *~ and .*.swp
Fix build with --with-json

Use PKG_CHECK_MODULES instead of AC_CHECK_LIB in Makefile.am, and use
LIBJSON_CFLAGS and LIBJSON_LIBS in src/Makefile.am
Remove trailing spaces
Merge pull request #1 from vlegout/cleanup

Cleanup