Fix errors on Linux

1. Fix the sqlite table assertion errors
2. Fix the Makefile on Linux