Update API to work with the latest toxcore version

Updates the API so it will work with the latest toxcore, fix the Makefile, and add an example.