I'm not sure if someone has answered your question. i am the author of the original document you refrerenced, and I wanted to make sure you got everythign working.
There is some confusion about the dnet libary required for Snort and for Barnyard2 on the ubuntu system:
The dnet library can be installed from souce (as shown in other posts) and will work without issue. If you look in the earlier sections of the install document, it shows that you should install the libdubmnet-dev library (sudo apt-get install libdubmnet-dev). this provides the dnet library. if you tried isntalling the dnet library this way: sudo apt-get install dnet, then you will have issues, as that is the incorrect library. If you installed the incorrect library, you must uninstall it, then install the correct library either from source or from the ubuntu repository.
once the library is installed, you must run sudo ldconfig to make the libraries avaliable to the system. if you don't run that command before you try to use them (during the make process of Barnyard2 for example), then you will see the errors you encountered, as the libraries are not avaliable to the system.
So in closing, running the following two commands should make Barnyard2 compile:
$ sudo apt-get install libdubmnet-dev
$ sudo ldconfig
The instructions in the guide are written to setup the entire snort system with supporting software. if you were using the guide to just install Barnyard2 on it's own, some of the steps from the section on installing Snort are pre-requisites, as Snort uses them. Continue to install as per the rest of the guide. If you continue to have issues, please let me know so I can determine the issue and update the guide as needed.
Noah