Catalysis of the reaction: ATP + deoxyribonucleotide(n) + deoxyribonucleotide(m) = AMP + diphosphate + deoxyribonucleotide(n+m).
poly(deoxyribonucleotide):poly(deoxyribonucleotide) ligase (AMP-forming)