The compilation errors are because of missing sqlite headers. But don't play with compilation of Calibre from sources, that won't solve your problem.
Your problem is probably either broken filesystem or write protection set. Have a look at the manual of your device:
http://docs.sony.com/release/PRS650.pdf
and search for protection and check that you have the protection off (the manual says that it should work device-only but who knows how they implemented it). If this is not the problem then you'll probably have to repair or reformat your filesystem (in any case, backup all contents of your device)