Updated everything to build extlibs correctly

Changed stb_image.c and ""_write.c to *.cpp so it builds as C++ (since
it uses C++ features and didn't build otherwise)