Automatically fix command errors like missing libraries and run again until success