Add check for broken symlinks to hacking scripts (#2895)

This is a possible fix for #2895.

It adds an additional check for broken symlinks to the current condition.