Agent-Environment Alignment via Automated Interface Generation