Remove pysqlite2 support.
Makefile: remove pysqlite2 workaround
Fix NameError.
Support SYNC setting in make.conf.

This fixes commit 73188d23c68989539a913716bb8a4132d2c43316 so that it
works with make.conf.