Two versions of libmodbus are currently maintained:
Download the tarball of the version you want and run
./configure; make; make install; to compile and install libmodbus on your system.
The latest stable release is also available in many Linux distributions:
You can also browse the source code on stephane/libmodbus or clone with the command:
$ git clone git://github.com/stephane/libmodbusto compile and test the latest version.