It is usually quite helpful to include the error message you get; “does not work” is not really much to go on.
I suspect all you need is to make your variable const
:
const mylib = "/home/mikel/mylibraries/libCbin_IO"
ccall((:lwrite,mylib), Cvoid, ())