Improved installation

Fixed several problems that prevented an installation done using make install from working.