Add Wunused-but-set-variable flag to src Makefile. Fix related unused-but-set warnings.