added automake patch, fixed cmds to operate in correct dirs