Fix build issues for external project