fix Makefile.am

remove no longer existing files
hackish way to integrate building the perl module
remove unused directories
add some tools for the package
add more missing files
fix handling undefined value