more amr fixes

This pull request fixes AMR mess with include/static declarations (avoids "unused" warnings). Also fixes rest of makefiles.