Made the linking script automatically detect files