Run autogen.sh if using autotools and don't change permission if file is a symbolic link
Since autotools use autogen.sh to generate a configure file I have added running of the autogen.sh file if it exists.
In addition, autotools seems to generate symbolic links to system files, which permissions cannot be changed so a check has been added to not change the permission if the file is a symbolic link