Here's how to fix this:
docker run \
--rm \
--volume "$(pwd)/:/src" \
--workdir "/src/" \
swift:5.3.1-amazonlinux2 \
/bin/bash -c "yum install -y libcurl-devel && \
swift build --product HelloWorld -c release -Xswiftc -static-stdlib"
This will install what is needed for the linking to succeed.