SQLite is a source only library. You embed the source into the application, not linking with it. So the undefined reference comes from the fact that you fail to include the source file of sqlite. Try compiling as
gcc -O3 sqliteTest.c sqlite3.c -o sqliteTest -lpthread -ldl