Fix recursive subdirectory build bug